/* Copyright 2008. All rights reserved. */
package org.bling.swt;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;

/*
 * <code>BlingLayoutData</code> is attached to every widget
 * created by Bling.
 * 
 * This extra data contains information related to the styling
 * and rendering of the widget.
 * 
 */
public final class BlingLayoutData {

  public boolean lineBreak = false;

  public int width = SWT.DEFAULT;
  public int height = SWT.DEFAULT;

  public int marginTop = 0;
  public int marginBottom = 0;
  public int marginLeft = 0;
  public int marginRight = 0;

  public boolean hidden = false;

  public int floatStyle = SWT.None;

  public BlingLayoutData() {
  }

  public BlingLayoutData(int width, int height) {
    this.width = width;
    this.height = height;
  }

  public BlingLayoutData(Point point) {
    this(point.x, point.y);
  }

  public void setLineBreak(boolean lineBreak) {
    this.lineBreak = lineBreak;
  }

  public boolean isLineBreak() {
    return lineBreak;
  }

  public int getMarginLeft() {
    return marginLeft;
  }

  public int getMarginRight() {
    return marginRight;
  }

  public int getMarginTop() {
    return marginTop;
  }

  public int getMarginBottom() {
    return marginBottom;
  }

  public boolean isFloat() {
    return (floatStyle != SWT.NONE);
  }

}
